<style>
.x-grid3-col-message { white-space:normal;}
</style>
<div id="log-grid-{projectname}-{buildtime}">

</div>
<script type="text/javascript">
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
logxml = function(){

    var myData = [
        {data}
    ];
	function formatDate(value, p, record) {
    return String.format(
                '<b>{0}</b>',
                value.dateFormat('Y-m-d H:i:s'));
    }
   
    // example of custom renderer function
    function change(val){
        if(val > 0){
            return '<span style="color:green;">' + val + '</span>';
        }else if(val < 0){
            return '<span style="color:red;">' + val + '</span>';
        }
        return val;
    }

    // example of custom renderer function
    function pctChange(val){
        if(val > 0){
            return '<span style="color:green;">' + val + '%</span>';
        }else if(val < 0){
            return '<span style="color:red;">' + val + '%</span>';
        }
        return val;
    }

    // create the data store
    var store = new Ext.data.SimpleStore({
        fields: [
           {name: 'id', type: 'int'},
           {name: 'date', type: 'date', dateFormat: 'timestamp'},
           'priority',
           'message'
        ]
    });
    store.setDefaultSort('id', 'desc');
    store.loadData(myData);

    // create the Grid
    var grid = new Ext.grid.GridPanel({
        store: store,
        columns: [
            {id:'id',header: "ID", width: 40, sortable: true, dataIndex: 'id'},
            {header: "Date", width: 140, sortable: false, dataIndex: 'date',renderer:formatDate},
            {header: "Prio", width: 40, sortable: true, dataIndex: 'priority'},
            {header: "Message", dataIndex: 'message', id:'message', autoScroll:true }
        ],
        stripeRows: true,
        autoExpandColumn: 'message',
        bufferResize: true,
        height:350,
        width:600,
        title:false,
        autoScroll: true
    });

    grid.render('log-grid-{projectname}-{buildtime}');
    

    grid.getSelectionModel().selectFirstRow();
   
};
logxml();
</script>